package com.yydream.dto;

import com.yydream.common.valid.AddGroup;
import com.yydream.common.valid.ListValue;
import com.yydream.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
public class SysUserDTO extends BaseDTO {

    @ApiModelProperty(name = "用户id")
    @NotNull(message = "id不能为空", groups = {UpdateGroup.class})
    private Long id;

    @ApiModelProperty(name = "用户名")
    @NotEmpty(message = "用户名不能为空", groups = {AddGroup.class})
    private String username;

    @ApiModelProperty(name = "密码")
    @NotEmpty(message = "密码不能为空", groups = {AddGroup.class})
    private String password;


    @ApiModelProperty(name = "电话",notes = "")
    @NotEmpty(message = "电话不能为空", groups = {AddGroup.class})
    private String phone ;

    @ApiModelProperty(name = "头像",notes = "")
    @NotEmpty(message = "头像不能为空", groups = {AddGroup.class})
    private String avatar ;

    @ApiModelProperty(name = "昵称",notes = "")
    @NotEmpty(message = "昵称不能为空", groups = {AddGroup.class})
    private String nickname ;


    @ApiModelProperty(name = "性别",notes = "（1：男，2：女）")
    @NotNull(message = "性别不能为空", groups = {AddGroup.class})
    @ListValue(value = {1, 2}, message = "性别只能是：（1：男，2：女）", groups = { AddGroup.class, UpdateGroup.class})
    private Integer sex ;


    @ApiModelProperty(name = "状态",notes = "（1：启用，2：禁用）")
    @NotNull(message = "状态不能为空", groups = {AddGroup.class})
    @ListValue(value = {1, 2}, message = "状态只能是：（1：启动，2：禁用）", groups = { AddGroup.class, UpdateGroup.class})
    private Integer state ;

}
